/**
 * 作者: wgx
 * 日期: 2024-10-18 10:45:14
 * 备注: 模块开启
 */
package com.motu.monstercity.server.game.commondata.system;

import io.vertx.core.json.JsonObject;

public class SystemOpenModel {
    protected int id; // 模块id
    protected int unlockType1; // 解锁条件的类型1
    protected int unlockParam1; // 解锁的需求值1
    protected int unlockType2; // 解锁条件的类型2
    protected int unlockParam2; // 解锁的需求值2
    protected int needBuild; // 必须的建筑id
    protected int type; // 类型 (0-功能，1-系统模块)
    protected String reward; // 系统模块解锁奖励

    public SystemOpenModel() {
    }

    public SystemOpenModel(JsonObject obj) {
        id = obj.containsKey("id") ? obj.getInteger("id") : 0;
        unlockType1 = obj.containsKey("unlock_type1") ? obj.getInteger("unlock_type1") : 0;
        unlockParam1 = obj.containsKey("unlock_param1") ? obj.getInteger("unlock_param1") : 0;
        unlockType2 = obj.containsKey("unlock_type2") ? obj.getInteger("unlock_type2") : 0;
        unlockParam2 = obj.containsKey("unlock_param2") ? obj.getInteger("unlock_param2") : 0;
        needBuild = obj.containsKey("need_build") ? obj.getInteger("need_build") : 0;
        type = obj.containsKey("type") ? obj.getInteger("type") : 0;
        reward = obj.containsKey("reward") ? obj.getString("reward") : "";
    }

    public int getId() {
        return id;
    }

    public int getUnlockType1() {
        return unlockType1;
    }

    public int getUnlockParam1() {
        return unlockParam1;
    }

    public int getUnlockType2() {
        return unlockType2;
    }

    public int getUnlockParam2() {
        return unlockParam2;
    }

    public int getNeedBuild() {
        return needBuild;
    }

    public int getType() {
        return type;
    }

    public String getReward() {
        return reward;
    }

}
